//数组定义示例
const numArr: number[] = [1,2,3];
const srrArr: string[] = ['a','b','c'];
const anyArr: (number|string)[] = [1,'2','3',4,'abc'];
//对象类型 - 普通
const objArr: {name: string, age: number}[] = [
    {name: '小花',age: 18},
    {name: '小明',age: 20}
];

//对象类型 - 别名
type Student = { name: string, age: number }
const aliasArr: Student[] = [
    { name: '小花', age: 18 },
    { name: '小明', age: 20 }
];

//对象类型 - 类
class Stud{
    name: string; 
    age: number;
}
const classArr: Stud[] = [
    { name: '小花', age: 18 },
    { name: '小明', age: 20 }
];
